package com.library_manager_system.utils;

import java.util.ArrayList;

import javax.swing.JPanel;

import com.library_manage_system.view.BookDataLoggingPanel;
import com.library_manage_system.view.BorrowBookPanel;
import com.library_manage_system.view.FindBookPanel;
import com.library_manage_system.view.ModifyBookPanel;
import com.library_manage_system.view.ReturnBookPanel;
import com.library_manage_system.view.StatisticsPanel;
import com.library_manage_system.view.WindowsMainImpl;
import com.library_manager_system.Book;

public class PanelFactory {
	
	public static JPanel createPanel(String type,ArrayList<Book> arraylist,WindowsMainImpl windowsMainimpl){
		
		JPanel jPanel = null;
		if(type.equals("BookDataLoggingPanel")){
			jPanel = BookDataLoggingPanel.getInstance(windowsMainimpl).strategy.createPanel(arraylist, windowsMainimpl);
		}else if(type.equals("BorrowBookPanel")){
			jPanel = BorrowBookPanel.getInstance(windowsMainimpl).strategy.createPanel(arraylist, windowsMainimpl);
		}else if(type.equals("ReturnBookPanel")){
			jPanel =ReturnBookPanel.getInstance(windowsMainimpl).strategy.createPanel(arraylist, windowsMainimpl);
		}else if(type.equals("FindBookPanel")){
			jPanel = FindBookPanel.getInstance(windowsMainimpl).strategy.createPanel(arraylist, windowsMainimpl);
		}else if(type.equals("ModifyBookPanel")){
			jPanel =ModifyBookPanel.getInstance(windowsMainimpl).strategy.createPanel(arraylist, windowsMainimpl);
		}else if(type.equals("StatisticsPanel")){
			jPanel = StatisticsPanel.getInstance(windowsMainimpl).strategy.createPanel(arraylist, windowsMainimpl);
		}
		return jPanel;
	}
	

}
